package day02;

/**
 * @author yzg
 * @desc TODO
 * @date 2025/4/8
 */
public class Test06 {
    public static void main(String[] args) {
        short s = 30;
        int i = 50;
        s += i;//short s = (short)(s + i)
        System.out.println("s="+s);//s=80

        int x = 0;
        int y = 0;
        int z = 0;
        boolean a,b;
        a = x>0 & y++>1;//x>0为false，y++为0，y++>1为false
        System.out.println("a="+a);//a=false
        System.out.println("y="+y);//y=1

        b = x>0 && z++>1;//x>0为false，逻辑&&短路
        System.out.println("b="+b);//b为false
        System.out.println("z="+z);//z=0

        a = x>0 | y++>1;//x>0为false，y++为1，y++>1为false
        System.out.println("a="+a);//a=false
        System.out.println("y="+y);//y=2

        b = x>0 || z++>1;//x>0为false，z++为0，z++>1为false
        System.out.println("b="+b);//b=false
        System.out.println("z="+z);//z=1
    }
}
